#include "SkeletonModel.h"
#include <fstream>
#include "StarlabException.h"
#include <QtOpenGL>
#include "SkeletonRenderer.h"
#include "helpers/QForEachHelpers.h"

using namespace std;
using namespace SkeletonTypes;

SkeletonModel::SkeletonModel(QString path, QString name) : Model(path,name){
    this->setRenderer( new SkeletonRenderer() );    
}

void SkeletonModel::updateBoundingBox(){
    Vector3VertexProperty vcoord = get_vertex_property<Vector3>(VCOORD);
    bbox.setToNull();
    foreach(Vertex v, this->vertices())
        bbox.unite( vcoord[v] );
}

SkeletonForEachEdgeHelper SkeletonModel::edges(){ 
    return SkeletonForEachEdgeHelper(this); 
}
SkeletonForEachVertexHelper SkeletonModel::vertices(){ 
    return SkeletonForEachVertexHelper(this); 
}


//Explicit Template Instantiation
template class WingedgeMesh <double, SkeletonTypes::SkelVector<double,3> >;
